package cn.spark.study.core

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

object LetterCountLocal {
  def main(args: Array[String]): Unit = {
    
     val conf = new SparkConf()
         .setAppName("LetterCountLocal")
         .setMaster("local")
     
     val lines = new SparkContext(conf).textFile("C://Users//e20160504//Desktop//spark.txt", 1)
     
     // 链式调用
     val count = lines.map { line => line.length() }.reduce(_ + _)
     
     println(count)
     
  }
}